package config

type DsnProvider interface {
	Dsn() string
}


type GeneralDB struct {
	DbType string `mapstructure:"db-type" json:"db-type" yaml:"db-type"`
	Ip     string `mapstructure:"ip" json:"ip" yaml:"ip"`
	Port string `mapstructure:"port" json:"port" yaml:"port"`
	Username string `mapstructure:"username" json:"username" yaml:"username"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
	Dbname string `mapstructure:"db-name" json:"db-name" yaml:"db-name"`
	Config string `mapstructure:"config" json:"config" yaml:"config"`
	Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
	Singular bool `mapstructure:"singular" json:"singular" yaml:"singular"`
	Engine string `mapstructure:"engine" json:"engine" yaml:"engine" default:"InnoDB"`
	MaxIdleConns int `mapstructure:"max-idle-conns" json:"max-idle-conns" yaml:"max-idle-conns"`
	MaxOpenConns int `mapstructure:"max-open-conns" json:"max-open-conns" yaml:"max-open-conns"`
	LogMode string `mapstructure:"log-mode" json:"log-mode" yaml:"log-mode"`
	LogZap bool `mapstructure:"log-zap" json:"log-zap" yaml:"log-zap"`
}

type SpecializedDB struct {
	Disable   bool   `mapstructure:"disable" json:"disable" yaml:"disable"`
	Type      string `mapstructure:"type" json:"type" yaml:"type"`
	AliasName string `mapstructure:"alias-name" json:"alias-name" yaml:"alias-name"`
	GeneralDB `yaml:",inline" mapstructure:",squash"`
}
